module.exports = {
  presets: [
    '@babel/preset-react',
    [
      '@babel/preset-env', {
        modules: false, // 不转译模块引入的语法
        useBuiltIns: 'usage', // 只对用到的新语法做语法实现，babel-pollify会自动引入
        corejs: 2,
        targets: [
          '> 1%',
          'last 2 versions'
        ]
      }
    ]
  ],

  plugins: [
    'react-hot-loader/babel',
    '@babel/plugin-syntax-dynamic-import',
    [
      '@babel/plugin-proposal-class-properties', {
        loose: true // 开启松散模式
      }
    ],
    [
      'import', {
        libraryName: 'antd',
        style: true
      }
    ]
  ]
};